﻿using MediatR;
using RBAC.Common.Domains.RabbitProject;
using RBAC.Common.Dto;
using RBAC.Common.infrastructures.interfaces;
using RBAC.Enum;

namespace RBAC.api.Application.commond.Provincescitiesandcounties
{
    public class provinceHandler:IRequestHandler<provinceCommond, Rulst>
    {

        private readonly IbaseRpository<Province> _Province;

        public provinceHandler(IbaseRpository<Province> province)
        {
            _Province = province;
        }

        public async Task<Rulst> Handle(provinceCommond request, CancellationToken cancellationToken)
        {


            var list = new Rulst() { Code = (int)Reult.success };




            list.data = _Province.Query().ToList();


            return list;


        }
    }
}
